package ch15;

import java.util.*;

public class Example15_3 {
    public static void main(String args[]){
        LinkedList mylist=new LinkedList();
        mylist.add("你");
        mylist.add("好");
        int number=mylist.size();
        for(int i=0;i<number;i++){
            String temp=(String)mylist.get(i);
            System.out.println("第"+i+"节点中的数据:"+temp);
        }
        Iterator iter=mylist.iterator();
        while(iter.hasNext()) {
            String te=(String)iter.next();
            System.out.println(te);
        }
    }
}
